<template>
  <div>
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recommend></Recommend>
    <Rank></Rank>
    <Like></Like>
    <Floor v-for="(floor, index) in floorList" :key="floor.id" :list="floor"></Floor>

    <Brand></Brand>
    <!-- <button @click="add">+1</button>
    <span>store中的数据{{ count }}</span>
    <button @click="sub">-1</button> -->
  </div>
</template>

<script>
import ListContainer from '@/pages/Home/ListContainer'
import Recommend from '@/pages/Home/Recommend'
import Rank from '@/pages/Home/Rank'
import Like from '@/pages/Home/Like'
import Floor from '@/pages/Home/Floor'
import Brand from '@/pages/Home/Brand'
import { mapState } from 'vuex'
// import { mapState } from 'vuex'
export default {
  name: '',
  components: {
    ListContainer,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  computed: {
    // ...mapState(['count']),
    // ...mapState({
    //   floorList:(state)=>{
    //      return state.home.floorList
    // })
    ...mapState({
      floorList: (state) => state.home.floorList,
    }),
  },
  methods: {
    // add() {
    //   //派发action  dispatch：含有异步操作，例如向后台提交数据，写法： this.$store.dispatch('action方法名',值)
    //   this.$store.dispatch('add')
    // },
    // sub(){
    //   this.$store.dispatch('sub')
    // }
  },
  
  mounted() {
    this.$store.dispatch('getFloorList')
    // this.$store.dispatch('getUserInfo')
  },
  
}
</script>

<style></style>
